home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / polski_aminet / piotr_pawlow / mapatch28->29 / patch.install < prev    next >
Text File  |  1997-05-14  |  2KB  |  74 lines

  1. ; MiniArcanoid Installer script
  2.  
  3. (procedure P_PATCHFILE #old #new #patch
  4.   (
  5.     (set #err
  6.       (run ("patch \"%s\" \"%s\" \"%s\" QUIET" #old #new #patch)) 
  7.     )
  8.     (if (<> #err 0)
  9.       (if (= #err 9)
  10.         (
  11.           (working ("File \"%s\" is already patched" #old))
  12.           (run ("wait 2"))
  13.         )
  14.         (abort
  15.           (select (- #err 10)
  16.             "Not enough memory"
  17.             "Read error"
  18.             "Wrong version of patch command\nor something strange has happened"
  19.             "*** BREAK ***"
  20.             ("Couldn't write file \"%s\"" #new)
  21.             ("Wrong \"%s\" file format" #patch)
  22.             ("Wrong \"%s\" file size.\nProbably it's incorrect version." #old)
  23.             ("Wrong \"%s\" file checksum.\nProbably the file has been altered." #old)
  24.           )
  25.         )
  26.       )
  27.     )
  28.   )
  29. )
  30.  
  31. (welcome)
  32.  
  33. (set #destdir
  34.     (askdir
  35.         (prompt "Select where are your MiniArcanoid files\n(Enter MiniArcanoid directory)")
  36.         (help @askdir-help)
  37.         (default @default-dest)
  38.     )
  39. )
  40.  
  41. (set #destexe (tackon #destdir "MiniArcanoid"))
  42. (set #destguide (tackon #destdir "MiniArcanoid.guide"))
  43. (set #destinstall (tackon #destdir "MiniArcanoid.install"))
  44.  
  45. (working "Patching MiniArcanoid executable...")
  46. (if
  47.   (not (exists #destexe))
  48.   (abort "MiniArcanoid executable not found!")
  49. )
  50. (P_PATCHFILE #destexe #destexe "MiniArcanoid.pch")
  51.  
  52. (copyfiles
  53.     (prompt "Copying new samples")
  54.     (source "")
  55.     (dest #destdir)
  56.     (help @copyfiles-help)
  57.     (pattern "#?.snd")
  58.     (infos)
  59. )
  60.  
  61. (if (exists #destguide)
  62.   (
  63.     (working "Patching MiniArcanoid documentation...")
  64.     (P_PATCHFILE #destguide #destguide "MiniArcanoid.guide.pch")
  65.   )
  66. )
  67. (if (exists #destinstall)
  68.   (
  69.     (working "Patching installer script...")
  70.     (P_PATCHFILE #destinstall #destinstall "MiniArcanoid.install.pch")
  71.   )
  72. )
  73. (exit)
  74.